<template>
  <div id="main">
    <a-layout id="components-layout-demo-custom-trigger">
      <a-layout-sider v-model="collapsed" :trigger="null" collapsible >
        <div class="logo">
            <img src="@/assets/img/logo.png" alt="">
        </div>
        <a-menu theme="dark" mode="inline" :default-selected-keys="['1']">
          <a-menu-item key="1" @click="changeMenu('index')">
            <a-icon type="home" />
            <span>首页</span>
          </a-menu-item>
          <a-menu-item key="2" @click="changeMenu('core')">
            <a-icon type="video-camera" />
            <span>个人中心</span>
          </a-menu-item>
        </a-menu>
      </a-layout-sider>
      <a-layout>
        <a-layout-header style="background: #fff; padding: 0">
          <a-icon
            class="trigger"
            :type="collapsed ? 'menu-unfold' : 'menu-fold'"
            @click="() => (collapsed = !collapsed)"
          />
        </a-layout-header>
        <template>
        <a-breadcrumb>
            <a-breadcrumb-item>首页</a-breadcrumb-item>
            <a-breadcrumb-item>挂号</a-breadcrumb-item>
        </a-breadcrumb>
        </template>
        <a-layout-content
          :style="{
            margin: '24px 16px',
            padding: '24px',
            background: '#fff',
            minHeight: '280px',
          }"
        >
          <router-view></router-view>
        </a-layout-content>
      </a-layout>
    </a-layout>
  </div>
</template>
<script>
export default {
  data() {
    return {
      collapsed: false,
    };
  },
  methods:{
        changeMenu(route){
            console.log(route)
            this.$router.push(route)
        }
  }
};
</script>
<style lang="scss" scoped>


#main{
    height: 100vh;
}
#components-layout-demo-custom-trigger{
    width: 100%;
    height: 100%;
}
#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}

#components-layout-demo-custom-trigger .trigger:hover {
  color: #1890ff;
}

.ant-menu-dark .ant-menu-item-selected .anticon {
    color: #00C8AA;
}
.ant-menu-dark .ant-menu-item-selected .anticon + span {
    color: #00C8AA;
}
.ant-menu.ant-menu-dark .ant-menu-item-selected, .ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected {
    background-color: #232730;
}

.logo{
    margin: 0;
    height: 70px;
    img{
        height: 100%;
        width: 100%;
    }
}

.ant-breadcrumb{
    margin-top: 10px;
    margin-left: 10px;
}

</style>